<?php
class MgroupModel extends Model {
	
	//自动验证文章内容
	protected $_validate=array(
			array('title','require','{$mgp_form_validata_title_required}'),
	);

	//自动填充内容  addtime
	protected $_auto   =   array(
		array('addtime','time',1,'function'),//add添加的时候自动填充
	);
	
	//根据分组编号获取对应的用户列表
	public function getUsersByGroupId($id){
		
		$mgroup = M("Memgroup");
		$sql    = $mgroup->field("userid")->where("groupid=$id")->select(false);
		
		$member = M("Member");
		$lists  = $member->where("id in ($sql)")->select();
		return $lists;
	}
}
?>